package com.j3a.journal.model;

// Generated 21 oct. 2014 14:53:50 by Hibernate Tools 4.0.0

import java.util.Date;

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * JournalistePersonnalite generated by hbm2java
 */
@Entity
@Table( name = "journaliste_personnalite"
        , catalog = "journal" )
public class JournalistePersonnalite implements java.io.Serializable {

    /**
     * 
     */
    private static final long         serialVersionUID = 1L;
    private JournalistePersonnaliteId id;
    private Journaliste               journaliste;
    private Personnalite              personnalite;
    private Date                      jrltePersDate;

    public JournalistePersonnalite() {
    }

    public JournalistePersonnalite( JournalistePersonnaliteId id, Journaliste journaliste, Personnalite personnalite ) {
        this.id = id;
        this.journaliste = journaliste;
        this.personnalite = personnalite;
    }

    public JournalistePersonnalite( JournalistePersonnaliteId id, Journaliste journaliste, Personnalite personnalite,
            Date jrltePersDate ) {
        this.id = id;
        this.journaliste = journaliste;
        this.personnalite = personnalite;
        this.jrltePersDate = jrltePersDate;
    }

    @EmbeddedId
    @AttributeOverrides( {
            @AttributeOverride( name = "journalisteId", column = @Column( name = "JOURNALISTE_ID", nullable = false, length = 30 ) ),
            @AttributeOverride( name = "personnaliteId", column = @Column( name = "PERSONNALITE_ID", nullable = false, length = 30 ) ) } )
    public JournalistePersonnaliteId getId() {
        return this.id;
    }

    public void setId( JournalistePersonnaliteId id ) {
        this.id = id;
    }

    @ManyToOne( fetch = FetchType.LAZY )
    @JoinColumn( name = "JOURNALISTE_ID", nullable = false, insertable = false, updatable = false )
    public Journaliste getJournaliste() {
        return this.journaliste;
    }

    public void setJournaliste( Journaliste journaliste ) {
        this.journaliste = journaliste;
    }

    @ManyToOne( fetch = FetchType.LAZY )
    @JoinColumn( name = "PERSONNALITE_ID", nullable = false, insertable = false, updatable = false )
    public Personnalite getPersonnalite() {
        return this.personnalite;
    }

    public void setPersonnalite( Personnalite personnalite ) {
        this.personnalite = personnalite;
    }

    @Temporal( TemporalType.DATE )
    @Column( name = "JRLTE_PERS_DATE", length = 10 )
    public Date getJrltePersDate() {
        return this.jrltePersDate;
    }

    public void setJrltePersDate( Date jrltePersDate ) {
        this.jrltePersDate = jrltePersDate;
    }

}
